package school.valon.constantes;

import school.valon.dto.StaffFunctionDto;

public enum EnumStaffFunction {
	TEACHER(1, "teacher"), COORDINATOR(2, "coordinator"),
	PRINCIPAL(3, "principal"), ADVISOR(4, "advisor");

	private int functionId;
	private String caption;
	private EnumStaffFunction(int functionId, String caption) {
		this.functionId = functionId;
		this.caption = caption;
	}

	public int getFunctionId() {
		return this.functionId;
	}
	public String getCaption() {
		return this.caption;
	}

	public static EnumStaffFunction getFunctionById(int functionId) {
		for(EnumStaffFunction enumTypeIt : EnumStaffFunction.values()) {
			if (enumTypeIt.functionId == functionId) {
				return enumTypeIt;
			}
		}
		return null;
	}

	public StaffFunctionDto getStaffFunctionDto() {
		StaffFunctionDto staffFunctionDto = new StaffFunctionDto();
		staffFunctionDto.setStaffFunctionId(this.functionId);
		return staffFunctionDto;
	}
}
